package com.keon.jianbao.api;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by keon on 2015/7/21.
 */
public class ApiResult {
    int status;
    String info;
    String value;

    public ApiResult(byte[] responseBody) throws JSONException {
        String response = new String(responseBody);
        JSONObject json = new JSONObject(response);
        this.status = json.getInt("status");
        this.info = json.getString("info");
        try {
            this.value = json.getString("value");
        } catch (Exception e) {
        }
    }

    public ApiResult(int status, String info, String value) {
        this.status = status;
        this.info = info;
        this.value = value;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
